<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
  <head>
    <base href="<%=basePath%>" />
    <title>Upload File of Allocator Data</title>
    <script type="text/javascript">
		var path = "<%=basePath%>";
	</script>
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
	<meta http-equiv="description" content="This is my page" />
	<link rel="stylesheet" type="text/css" href="<%=basePath%>beshs/css/content.css" />
	<link type="text/css" href="<%=basePath%>beshs/css/frame_style.css" rel="stylesheet" />
	<link type="text/css" href="<%=basePath%>beshs/css/element_style.css" rel="stylesheet" />
	<script type="text/javascript" src="<%=basePath%>resources/jquery/jquery-1.7.2.min.js"></script>
	<!-- 系统通用资源 -->
	<jsp:include page="/resources/resource-refer/common-resource-reference.jsp" />
	<!-- 用户访问菜单路径 -->
	<jsp:include page="/resources/usertrace/common-uservisit-reference.jsp" />
	<!-- iframe高度自适应 -->
	<script type="text/javascript">
        function getOsName() { 
    		var OsObject = ""; 
		   	if(navigator.userAgent.indexOf("MSIE")>0) { 
		    	return "MSIE"; 
		   	} 
		   	if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){ 
		        return "Firefox"; 
		   	} 
		   	if(isSafari=navigator.userAgent.indexOf("Safari")>0) { 
		        return "Safari"; 
		   	}  
		  	if(isCamino=navigator.userAgent.indexOf("Camino")>0){ 
		        return "Camino"; 
		   	} 
		   	if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){ 
		        return "Gecko"; 
		   	} 
		} 
        
        /** 根据浏览器类型选择iframe自适应方式 **/
        function setIframeHeightAutosize() {
        	//获取Iframe对象 ie和firefox都可以获得
        	var meterDataIframe = document.getElementById("meterDataPage"); 
        	try{
                if(getOsName() == 'MSIE'){
                    var lbHeight = meterDataIframe.document.body.scrollHeight; //IE
                    meterDataIframe.style.height =  lbHeight + "px"; 
                }else if(getOsName() == 'Firefox'){
                    var lfHeight = meterDataIframe.contentDocument.body.scrollHeight; //FireFox 
                    meterDataIframe.height = lfHeight + "px";   
                } else {
                    meterDataIframe.style.height = 400 + "px";
                }          
            } catch (ex){}
		}
		
		$(function() {
			setIframeHeightAutosize();
		})
    </script>
  </head>
  <body>
  	<div class="content_all">
  		<!--导航条-->
  		<div class="insertinfo_table">
		  	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		  		<tr>
		  			<th style="text-align: center;" colspan="6" >Upload File of Allocator Data</th>
		  		</tr>
		  		 <tr>
		        	<th>File Name：</th>
		          	<td><s:property value="meterDataFile.fileName" />
		          	</td>
		          	<th>File Size</th>
		          	<td>
		          		<s:if test="meterDataFile.fileSize<1024">
		          			<s:text name="fmt.number.precision.zero">
					        	<s:param value='meterDataFile.fileSize' />
					        </s:text>Byte
		          		</s:if>
		          		<s:elseif test="meterDataFile.fileSize>1024 && meterDataFile.fileSize<1024*1024">
		          			<s:text name="fmt.number.precision.three">
					          	<s:param value='meterDataFile.fileSize/1024' />
					        </s:text>KB
		          		</s:elseif>
		          		<s:else>
		          			<s:text name="fmt.number.precision.three">
					          	<s:param value='meterDataFile.fileSize/1024/1024' />
					       	</s:text>MB
		          		</s:else>
		          	</td>
		          	<th>Record Quantity：</th>
		        	<td><s:property value='meterDataFile.recordNum' /></td>
		        </tr>
		  		<tr>
		        	<th>Allocator Quantity：</th>
		        	<td><s:property value='meterDataFile.meterNum' /></td>
		        	<th>Successful Upload Quantity：</th>
		        	<td><s:property value='meterDataFile.successNum' /></td>
		        	<th>Upload Ratio：</th>
		        	<td><s:property value="meterDataFile.uploadPercent" />%</td>
		        </tr>
		        <tr>
		        	<th>Submitters：</th>
		        	<td><s:property value="meterDataFile.uploadMan" /></td>
		       	 	<th>Upload Time：</th>
		        	<td>
		          		<s:date name='meterDataFile.uploadDate' format='yyyy-MM-dd HH:mm:ss' nice='false' />
		          	</td> 
		        	<td style="border:none" colspan="2">
          				<script type="text/javascript">
          					$(function() {
          						$("input[name='goBack']").click(function() {
          							window.location = path + "beshs/assignMeterDataFileAction!queryDataFilePage.do?date="+new Date();
          						});
          					})
          				</script>
            			<input name="goBack" type="reset" value="Return" class="s_btn"/></td>
		        </tr> 
		    </table>
		</div>
	</div>
	<div class="clear"></div>
	<div class="content_all">
	  	<table cellpadding="0" class="frame_right" cellspacing="0" border="0" height="100%" width="100%">
  		<tr>
  			<td>
  			<!-- TXT上传的分配表数据列表 -->
  				<script type="text/javascript">
  					$(function() {
  						//TXT上传的分配表数据
  						var dataFileUID = "<s:property value='meterDataFile.id' />";
  						window.frames["meterDataPage"].location = path + "beshs/assignMeterDataGatherAction!queryMeterDataPageByFileID.do?dataFileUID="+dataFileUID
  								+"&date="+new Date();
  					});
  				</script>
  				<iframe frameborder="0" scrolling="auto" name="meterDataPage" id="meterDataPage" src="<%=basePath%>common/empty.jsp" height="100%" width="100%"></iframe>
  			</td>
  		</tr>
  	</table>
	</div>
  </body>
</html>
